package app.excel.base;

import cn.lily.com.configure.util.ESBSetting;
import cn.lily.esb.enums.EnumManager;
import cn.lily.esb.enums.base.EnumDetail;
/**
 * 动漫枚举
 * @author JiaJ
 *
 */
public class ExcelEnum {
	
	private EnumDetail quaEnum;
	private EnumDetail srcEnum;
	private EnumDetail areaEnum;
	private EnumDetail statEnum;
	private EnumDetail kindEnum;
	
	public void loadEnum(){
		
		if(ESBSetting.getBoolean("isOnline")){
			this.quaEnum = EnumManager.getTableEnum("CAN_QUA");
			this.srcEnum = EnumManager.getTableEnum("CAN_SOURCE");
			this.areaEnum = EnumManager.getTableEnum("CAN_AREA");
			this.statEnum = EnumManager.getTableEnum("CAN_STAT");
			this.kindEnum = EnumManager.getTableEnum("CAN_KIND");
		}else{
			this.quaEnum = EnumManager.getOfflineEnumTyp("CAN_QUA");
			this.srcEnum = EnumManager.getOfflineEnumTyp("CAN_SOURCE");
			this.areaEnum = EnumManager.getOfflineEnumTyp("CAN_AREA");
			this.statEnum = EnumManager.getOfflineEnumTyp("CAN_STAT");
			this.kindEnum = EnumManager.getOfflineEnumTyp("CAN_KIND");
		}
	}
	
	public String getQua(String key){
		return this.quaEnum.getElementValue(key);
	}
	
	public String getSrc(String key){
		return this.srcEnum.getElementValue(key);
	}
	
	public String getArea(String key){
		return this.areaEnum.getElementValue(key);
	}
	
	public String getStat(String key){
		return this.statEnum.getElementValue(key);
	}
	
	public String getKind(String key){
		return this.kindEnum.getElementValue(key);
	}
	
}
